<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[|.siteName|]</title>
    [|if .zTree|]
    <link rel="stylesheet" href="/static/zTree3/css/demo.css?t=5" type="text/css">
    <link rel="stylesheet" href="/static/zTree3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    [|end|]
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/main.css">
    <script src="/static/layui/layui.js?s=36"></script>
    <script src="/static/js/main.js?s=2124"></script>
</head>

<body>
<div>
    <form>
        <div class="layui-input-inline">
            

            <div class="layui-inline">
                <label class="layui-form-label">时间:</label>
                <div class="layui-input-inline" style="width:100px;">
                    <input type="text" name="BeforDateTime" id="BeforDateTime" lay-verify="date" placeholder="" autocomplete="off" class="layui-input" value="">

                </div>
                <label>-</label>
                <div class="layui-input-inline" style="width:100px;">
                    <input type="text" name="AfterDateTime" id="AfterDateTime" lay-verify="date" placeholder="" autocomplete="off" class="layui-input" value="">
                </div>
            </div>

            <div class="layui-inline">
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="starquery">开始查询</button>
            </div>

        </div>
        <br />
        <hr class="layui-bg-gray">
        <div>
            <p>
                <label id="" style="color:rgb(0, 0, 0);">总输赢:</label>
                <label id="userallwin" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,总充值:</label>
                <label id="UserReChargeTotal" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,总赠送比:</label>
                <label id="UserSendPrcent" style="color:red;">0</label>
                <label id="" style="color:rgb(0, 0, 0);">,GM总添加:</label>
                <label id="gmaddAll" style="color:red;">0</label>
                 <label id="" style="color:rgb(0, 0, 0);">,总顺差:</label>
                <label id="allsurplus" style="color:red;">0</label>
            </p>
        </div>

    </form>
    <table  class="layui-table" id="userinfotable" lay-size="sm" lay-filter="layfilteruserinfotable"> </table> 
</div>

<script>
    var $;

    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery','table','laydate'], function(){
        var table = layui.table;
        var element = layui.element;
        var form = layui.form;
        var laydate = layui.laydate;
        $ = layui.jquery;
    //监听表格复选框选择
   // table.on('checkbox(demo)', function(obj){
    //   console.log(obj);
   // });

    //监听工具条
    laydate.render({
        elem: '#BeforDateTime'
      });
    laydate.render({
        elem: '#AfterDateTime'
    });
 

    ShowUserDatas();
    ShowTablesDatas(table)
    form.on('submit(starquery)', function(data) { 
        ShowTablesDatas(table)   
        return false;
    });


   
    return false;
}); 


function ShowTablesDatas(thisTabble){
 

    var dBeforDateTime =  document.getElementById("BeforDateTime");
    var dAfterDateTime =  document.getElementById("AfterDateTime");

    thisTabble.render({
        elem:'#userinfotable'
        ,url:'/extremevipmanage/platfromdetailtable'
        ,where: {
               
                BeforDateTime:dBeforDateTime.value
                ,AfterDateTime:dAfterDateTime.value
        
        }
        ,done: function(res, curr, count) {
            GetPageTitleData(res.titleinfo)
        }
        ,cols: [[ //标题栏
        
            {field:'columnA',title:'时间',width:110 }
            ,{field:'columnB',title:'注册',width:80}
            ,{field:'columnC',title:'登录',width:80}
            ,{field:'columnD',title:'充值(元）',width:100}
            ,{field:'columnE',title:'最高在线',width:100}
            ,{field:'columnF',title:'GM添加金币',width:120}
            ,{field:'columnG',title:'系统金币',width:130}
            ,{field:'columnH',title:'玩家金币',width:130}
            ,{field:'columnI',title:'至尊VIP金币',width:130}
            ,{field:'columnJ',title:'赠送礼物金币',width:130}
            ,{field:'columnK',title:'顺差A',width:120}
            ,{field:'columnL',title:'系统输赢B',width:130}
            ,{field:'columnM',title:'赠送比',width:60}
            ,{field:'columnN',title:'剩余血池',width:100}
            ,{field:'columnO',title:'交易人数',width:90}
            ,{field:'columnP',title:'交易笔数',width:90}
                ]] 
        ,skin: 'row' //表格风格
        ,even: true
        ,page: true //是否显示分页
        ,limits: [50,100,200]
        ,limit: 100//每页默认显示的数量
        ,width: 'full-10'
        ,rules: 'all'
        ,height: 'full-170'
    });
}

function GetPageTitleData(titleinfo){
   // alert(JSON.stringify(titleinfo))
    //if (titleinfo.length > 0)
    {
        document.getElementById("userallwin").innerHTML = titleinfo["TSWL"];
        document.getElementById("UserReChargeTotal").innerHTML = titleinfo["TRMB"];
        document.getElementById("UserSendPrcent").innerHTML = titleinfo["TBSP"];
        document.getElementById("gmaddAll").innerHTML = titleinfo["TGMGD"];
        document.getElementById("allsurplus").innerHTML = titleinfo["TSC"];
        
    }
  
    return false;
 
}

function ShowUserDatas()
{
    var dBeforDateTime =  document.getElementById("BeforDateTime");
    dBeforDateTime.value = getNowFormaOnetDate();
    var dAfterDateTime =  document.getElementById("AfterDateTime");
    dAfterDateTime.value = getNowFormatDate();     
          
} 

function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
 
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
    return currentdate;    
} 
function getNowFormaOnetDate() {
    var date = new Date();
    var seperator1 = "-";
 
    var month = date.getMonth() + 1;
    var strDate = 1;
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
    return currentdate;    
} 

</script>
</body>

</html>